var a = require("../../../utils/function.js"), e = getApp(), s = require("../../../api.js");

Page({
    data: {
        img: a.userImg,
        page: 1,
        data: []
    },
    onLoad: function(a) {
        a.uid && e.shareCouponsMessage(a.uid);
    },
    onReady: function() {},
    onShow: function() {
        this.list();
    },
    list: function() {
        var a = this, t = a.data.page;
        wx.showLoading(), e.request({
            url: s.message.getmessage,
            method: "post",
            data: {
                page: t,
                is_user: 0
            },
            success: function(e) {
                for (var s = a.data.data, e = e.data.data, t = 0; t < e.length; t++) s.push(e[t]);
                a.setData({
                    data: s
                }), wx.hideLoading();
            }
        });
    },
    onReachBottom: function(a) {
        var e = this.data.page;
        e++, this.setData({
            page: e
        }), this.list();
    },
    onShareAppMessage: function() {
        return {
            title: e.shareAppMessage().title,
            imageUrl: e.shareAppMessage().imageUrl,
            desc: e.shareAppMessage().desc,
            path: e.shareAppMessage().path
        };
    }
});